package com.zj.leetcode.easy.dynamicProgramming;

/**
 * @program algorithm
 * @description:
 * @author: zhangbo
 * @create: 2022/04/29 23:24
 */
public class FibonacciNumber {
    public static void main(String[] args) {
        Solution solution = new FibonacciNumber().new Solution();
    }

    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public int fib(int n) {
            int res = 0;
            int tmp = 1;

            for (int i = 0; i < n; i++) {
                res += tmp;
                tmp = res - tmp;
            }

            return res;
        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}